import { BasicPageSearch, BasicPageResult } from "./basicType";

export type MyMaterialOverview = {
    totalSpace?: string;
    remainingSpace?: string;
}

export type MaterialPageSearch = BasicPageSearch & {
    tagList: number[]; // 选择的标签
}

export type Material = {
    id: number;
    name?: string;
    pic?: string;
    url?: string;
    status?: number;
    createTime?: string;
    createUser?: number;
    tags?: string[];
}

export type MaterialPageResult = BasicPageResult & {
    records: Material[];    
}

export type MyMaterial = {
    id: number;
    fileName?: string;
    fileSize?: number;
    createdAt?: string;
    fileUrl?: string;
    fileExt?: string;
}

export type MyMaterialPageResult = BasicPageResult & {
    records: MyMaterial[];    
}

export type RecMaterialPageSearch = BasicPageSearch & {
    rec?:  number; // 位置, 10-专题页；11-精选首页; 12-包括10和11
}

export type RecMaterial = {
    documentsId?: number;
    name?:     string;
    pic?:      string;
    url?:      string;
}

export type RecMaterialPageResult = BasicPageResult & {
    records: RecMaterial[];    
}

/**
 * 资料包信息
 */
export type DocPkgInfo = {
    /**
     * 资料包ID
     */
    documentsPkgId: number;

    /**
     * 资料名称
     */
    name: string;

    /**
     * 配图
     */
    pic: string;

    /**
     * 介绍
     */
    intro: string;
}

// 资料包分页搜索条件
export type DocPkgPageSearch = BasicPageSearch & {
      
}

// 资料包分页搜索结果
export type DocPkgPageResult = BasicPageResult & {
    records: DocPkgInfo[];    
}

// 资料包资料标签
export type DocPkgMaterialTag = {
    id: number,
    refId?: number,
    type?: number,
    tagId?: string,
    tagName?: string
}

// 资料包资料信息
export type DocPkgMaterial = Material & {
    isRec?: number;
    tags?: DocPkgMaterialTag[];
}

// 资料包资料分页搜索条件
export type DocPkgMaterialPageSearch = {
    docPkgId: number;
}

// 资料包资料分页搜索结果
export type DocPkgMaterialPageResult = BasicPageResult & {
    records?: DocPkgMaterial[];
}
